package Order.sqlclass;

import java.util.Set;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;

@Table(name="goods")
@Entity
public class Goods {
	@Id
	@Column(name="id")
	private int id;
	@Column(name="code")
	private int code;
	@Column(name="name")
	private String name;
	@Column(name="yuan")
	private int yuan;
	@Column(name="goods_amount")
	private int goods_amount;
	@Column(name="remain_amount")
	private int remain_amount;
	@Column(name="description")
	private String description;
	
	@OneToMany
	@JoinColumn(name="goods_id")
	private Set<Business> business;
	
	@OneToMany
	@JoinColumn(name="goods_id")
	private Set<Order> order;
	
	public Goods(){
		
	}
	public int getId() {
		return id;
	}
	public void setId(int id) {
		this.id = id;
	}
	public int getCode() {
		return code;
	}
	public void setCode(int code) {
		this.code = code;
	}
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	public int getYuan() {
		return yuan;
	}
	public void setYuan(int yuan) {
		this.yuan = yuan;
	}
	public int getGoods_amount() {
		return goods_amount;
	}
	public void setGoods_amount(int goods_amount) {
		this.goods_amount = goods_amount;
	}
	public int getRemain_amount() {
		return remain_amount;
	}
	public void setRemain_amount(int remain_amount) {
		this.remain_amount = remain_amount;
	}
	public String getDescription() {
		return description;
	}
	public void setDescription(String description) {
		this.description = description;
	}
	
	public Set<Business> getBusiness() {
		return business;
	}
	public void setBusiness(Set<Business> business) {
		this.business = business;
	}
	public Set<Order> getOrder() {
		return order;
	}
	public void setOrder(Set<Order> order) {
		this.order = order;
	}
	@Override
	public String toString() {
		return "Goods [id=" + id + ", code=" + code + ", name=" + name + ", yuan=" + yuan + ", goods_amount="
				+ goods_amount + ", remain_amount=" + remain_amount + ", description=" + description + "]";
	}
	
	
}
